﻿<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=mTePrDFVkrXBzMWmNCdemNTp"></script>
@model PurchaseOrder
@section ToolBar{}
<div class="l-m-form">
    <form mark="LedinghuoForm" action="@Url.Action("Edit")" method="POST">
        @Html.LEditorFor(m => m.PurchaseOrderNo, Html.TextBoxFor, new { @disabled = "disabled" }, false)
        @Html.HiddenFor(m => m.PurchaseOrderNo)
        <div class="form-item inline-block">
            <div class="label c5">业务员</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("OrderEmployeeBox", (Model.OrderEmployee != null) ? Model.OrderEmployee.EmployeeName : "", "OrderEmployeeId", "text", new { data = Model.OrderEmployeeId, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "业务员不允许空" } }, null)
            </div>
        </div>

        <div class="form-item">
            <div class="label c5">客户</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("ProviderBox", (Model.Provider != null) ? Model.Provider.CompanyName : "", "ProviderId", "text", new { data = Model.OrderEmployeeId, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "客户不允许空" } }, null)
            </div>
        </div>
        <div class="form-item">
            <div class="label c5">仓库</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("StoreBox", (Model.Store != null) ? Model.Store.StoreName : "", "StoreId", "text", new { data = Model.StoreId, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "仓库不允许空" } }, null)
            </div>
        </div>
        @Html.LEditorFor(m => m.ContactName, Html.TextBoxFor)
        @Html.LEditorFor(m => m.Phone, Html.TextBoxFor)
        @{Html.RenderPartial("PurchaseOrderLine", Model.PurchaseOrderLines);}

        @Html.LEditorFor(m => m.ActualAmount, Html.TextBoxFor)
        @Html.LEditorFor(m => m.Remark, Html.TextAreaFor)
        @Html.LEditorFor(m => m.DeliveryRemark, Html.TextAreaFor)
        @Html.LButton("保存")
    </form>
    @Html.LPageError()
</div>
<script type="text/javascript">
    $(function () {
        $("#OrderEmployeeBox").employee(function ($this) {
            $("#OrderEmployeeId").val($this.attr("data"));
        });
        $("#ProviderBox").provider(function ($this) {
            $("#ProviderId").val($this.attr("data"));
        });
        $("#StoreBox").store(function ($this) {
            $("#StoreId").val($this.attr("data"));
        });
        
    });
</script>